using System;

namespace codebase
{
    public static class ColorExtensions
    {
        public static int RGB(int r, int g, int b)
        {
            return b + (g << 8) + (r << 16);
        }

        public static int RGB16(int red, int green, int blue)
        {
            int outR = ((red * 31) / 255);
            int outG = ((green * 63) / 255);
            int outB = ((blue * 31) / 255);

            return (outR << 11) | (outG << 5) | outB;
        }

        public static int WHITE16 = RGB16(255, 255, 255);
        public static int BLACK16 = RGB16(0, 0, 0);
        public static int RED16 = RGB16(255, 0, 0);
        public static int GREEN16 = RGB16(0, 255, 0);
        public static int BLUE16 = RGB16(0, 0, 255);
    }
}
